package jinyilw.swing.hint;
import jinyilw.common.hint.HintTools;
import jinyilw.common.hint.Hinter;
import jinyilw.swing.visuals.Rcomp.ROptionPane;
public class SwingHinter implements Hinter
{
	@Override
	public void hint(String msg)
	{
		HintWindow.showHint(msg);
	}
	@Override
	public void hint(String title, String msg)
	{
		ROptionPane.showMessageDialog(null, msg, title);
	}
	@Override
	public boolean confirm(String msg)
	{
		return ROptionPane.showConfirmDialog(null, msg) == 0;
	}
	@Override
	public boolean confirm(String title, String msg)
	{
		return ROptionPane.showConfirmDialog(null, msg, title) == 0;
	}
	@Override
	public Object confirm(String title, String msg, Object... objects)
	{
		return null;
	}

	private static SwingHinter hinter;
	public static void init()
	{
		if (hinter == null)
			hinter = new SwingHinter();
		HintTools.setDelegation(hinter);
	}
}
